<?php
ob_clean();
ob_start();
require_once("initsession.php");
require_once("../classes/database.php");
require_once("../classes/dblog.php");
require_once("../classes/generate_form.php");
require_once("../classes/user.php");
require_once("../functions/functions.php");
require_once("../functions/form.php");
require_once("../functions/rewrite_function.php");
require_once("../functions/date_functions.php");
require_once("../config/config.php");
require_once("../includes/inc_config.php");
$myuser = new user();
function _loadController($router){
    $router = strtolower($router);
    $router = str_replace('controller','',$router);
    //Đầu tiên load ở mycontroller trước
    if(file_exists('../mycontrollers/'.$router.'.php'))
        require_once '../mycontrollers/'.$router.'.php';
    //Neu khong co thi load o controller goc
    else if(file_exists('../controllers/'.$router.'.php'))
        require_once '../controllers/'.$router.'.php';
}
function _loadClass($router){
    $router = strtolower($router);
    if(file_exists('../classes/'.$router.'.class.php'))
        require_once '../classes/'.$router.'.class.php';
}
spl_autoload_register('_loadController');
spl_autoload_register('_loadClass');
?>